#include <gtest/gtest.h>

#include "jsi_executor/JSIExecutor.h"
#include "utils/Logger.h"
#include "jsi/test/testlib.h"

class JSIExecutorTest : public JSITestBase {
 public:
  void jsiCreateObject(jsiexecutor::JSIExecutor* jsiExecutor) {
    logInfo("jsiCreateObject run start\n");
    std::string json = R"({"x":1, "y":2})";
    jsiExecutor->setGlobalVariable("$data", json);
    logInfo("jsiCreateObject run end\n");
  }

  int countOccurrences(const std::string& str, const std::string& substr) {
    int count = 0;
    for (size_t i = 0; (i = str.find(substr, i)) != std::string::npos;) {
      count++;
      i++;
    }
    return count;
  }
};